From 47bb754959f271c5e61fce01930bec9ffce69024 Mon Sep 17 00:00:00 2001 From: "dan@guaranine.beaverton.ibm.com" Date: Sat, 12 Nov 2005 18:25:12 +0100 Subject: [PATCH] This test was failing for he wrong reason. Calls to block-attach after the first *should* report failure, so the test should not fail because of this. The test now fails because multiple calls to block-attach seem to detach the block devicem, which is wrong. Signed-off-by: Dan Smith --- .../block-create/04_block_attach_device_repeatedly_pos.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py b/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py index 7d56509bee..63a79965af 100644 --- a/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py +++ b/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py @@ -38,11 +38,13 @@ except ConsoleError, e: for i in range(10): status, output = traceCommand("xm block-attach %s phy:ram1 sdb1 w" % domain.getName()) - if status != 0: - FAIL("xm block-attach returned invalid %i != 0" % status) + if i == 0 and status != 0: + FAIL("xm block attach returned invalid %i != 0" % status) + if i > 0 and status == 0: + FAIL("xm block-attach (repeat) returned invalid %i > 0" % status) run = console.runCmd("cat /proc/partitions") if not re.search("sdb1", run['output']): - FAIL("Device is not actually attached to domU") + FAIL("Device is not actually attached to domU") # Close the console console.closeConsole() -- 2.30.2